﻿using AutoMapper;
using B.MES.FLH.WarehouseManagement.Application;
using B.MES.FLH.WarehouseManagement.Application.Dtos.Externallabel;
using B.MES.FLH.WarehouseManagement.Domain.Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Standard;
using Yitter.IdGenerator;

namespace B.MES.FLH.WarehouseManagement.Controllers
{
    /// <summary>
    /// 外箱标签解析管理
    /// </summary>
    [Route("api/[controller]")]
    [ApiController]
    public class ExternallabelController : ControllerBase
    {
        private readonly IService _service;
        public ExternallabelController(IService service)
        {
            _service = service;
        }
        /// <summary>
        /// 创建外部标签
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("CreateEXTERNALLABELMODEL")]
        public ApiResult<int> CreateEXTERNALLABELMODEL(CreateEXTERNALLABELModelInput input)
        {
            return _service.CreateEXTERNALLABELMODEL(input);
        }
        /// <summary>
        /// 修改外部标签
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost("UpdateEXTERNALLABELMODEL")]
        public ApiResult<int> UpdateEXTERNALLABELMODEL(UpdateEXTERNALLABELModelInput input)
        {
            return _service.UpdateEXTERNALLABELMODEL(input);
        }
        /// <summary>
        /// 删除外部标签
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPost("DeleteEXTERNALLABELMODEL")]
        public ApiResult<int> DeleteEXTERNALLABELMODEL(string id)
        {
            return _service.DeleteEXTERNALLABELMODEL(id);
        }
        /// <summary>
        /// 获取外部标签列表
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        [HttpGet("GetEXTERNALLABELMODEL")]
        public ApiPaging<EXTERNALLABELModelOutput> GetEXTERNALLABELMODEL([FromQuery]PageEXTERNALLABEL page)
        {
            return _service.GetEXTERNALLABELMODEL(page);
        }
        /// <summary>
        /// 获取外部标签详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("GetEXTERNALLABELDESC")]
        public ApiResult<EXTERNALLABELDescOutput> GetEXTERNALLABELDESC(string id)
        {
            return _service.GetEXTERNALLABELDESC(id);
        }
    }
}
